
# FROM java:8
FROM canal/osbase:v1
LABEL "author" = "lixiaoxia"

ENV CANAL_VERSION=1.1.5
# https://github.com/alibaba/canal/releases/download/canal-1.1.5-alpha-2/canal.deployer-1.1.5-SNAPSHOT.tar.gz

ADD https://github.com/alibaba/canal/releases/download/canal-${CANAL_VERSION}-alpha-2/canal.deployer-${CANAL_VERSION}-SNAPSHOT.tar.gz /tmp

RUN cd /tmp && \
    mkdir canal && \
    tar zxvf canal.deployer-${CANAL_VERSION}-SNAPSHOT.tar.gz -C /tmp/canal && \
    mv canal /

RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo 'Asia/Shanghai' >/etc/timezone

WORKDIR /canal


COPY ./entrypoint.sh /canal/bin/
COPY conf/canal.properties /canal/conf/
COPY conf/instance.properties /canal/conf/example/

CMD ["sh", "/canal/bin/entrypoint.sh"]